<?php
/**
 * author: crisen
 * email: crisen@crisen.org
 * date: 19-1-18
 * description:
 */


if (!function_exists('isWechatBrowser')) {
    function isWechatBrowser()
    {
        if (strpos(request()->userAgent(), 'MicroMessenger') !== false) {
            return true;
        }
        return false;
    }
}


if (!function_exists('generateOrderNo')) {
    function generateOrderNo($id = 0)
    {
        $orderNumber = date('YmdHis') . mt_rand(10, 49) . str_pad($id, 6, '0', STR_PAD_LEFT);
        return $orderNumber;
    }
}